@echo off
call conda activate NLU || (
    echo Failed to activate Conda environment
    echo Please check environment name and ensure Conda is initialized
    pause
    exit /b 1
)

set WANDB_MODE=offline

:: Define the rank pairs
set rank_pairs=1:2

for %%R in (%rank_pairs%) do (
    for /f "tokens=1,2 delims=:" %%A in ("%%R") do (
        set target_rank=%%A
        set lora_r=%%B

        echo Running whit task : stsb, seed: 15, rank:%%B to %%A, mode:Ada, Iidea: none, RS_flag:False
        python ../examples/text-classification/run_glue.py ^
          --model_name_or_path ../microsoft/deberta-v3-base ^
          --task_name stsb ^
          --apply_lora --apply_adalora --lora_type svd ^
          --RS_flag False ^
          --target_rank %%A  --lora_r %%B   ^
          --reg_orth_coef 0.3 ^
          --init_warmup 800 --final_warmup 2000 --mask_interval 10 ^
          --beta1 0.85 --beta2 0.85 ^
          --mode Ada --Iidea none ^
          --lora_module query,key,value,intermediate,layer.output,attention.output ^
          --lora_alpha 32 ^
          --do_train --do_eval --max_seq_length 128 ^
          --per_device_train_batch_size 32 --learning_rate 2.2e-3 ^
          --num_train_epochs 25 --warmup_steps 100 ^
          --cls_dropout 0.2 --weight_decay 0.1 ^
          --evaluation_strategy steps --eval_steps 100 ^
          --save_strategy steps --save_steps 10000 ^
          --logging_steps 50 ^
          --tb_writter_loginterval 50 ^
          --report_to tensorboard ^
          --seed 15 ^
          --root_output_dir ../output/Ablation/Ada-none-RsFalse/stsb-seed15-rank%%Bto%%A ^
          --overwrite_output_dir
    )
)